<?php
$tdatatbl_danh_muc_san_pham=array();
	$tdatatbl_danh_muc_san_pham[".NumberOfChars"]=80; 
	$tdatatbl_danh_muc_san_pham[".ShortName"]="tbl_danh_muc_san_pham";
	$tdatatbl_danh_muc_san_pham[".OwnerID"]="";
	$tdatatbl_danh_muc_san_pham[".OriginalTable"]="tbl_danh_muc_san_pham";


	
//	field labels
$fieldLabelstbl_danh_muc_san_pham = array();
if(mlang_getcurrentlang()=="English")
{
	$fieldLabelstbl_danh_muc_san_pham["English"]=array();
	$fieldToolTipstbl_danh_muc_san_pham["English"]=array();
	$fieldLabelstbl_danh_muc_san_pham["English"]["id"] = "Id";
	$fieldToolTipstbl_danh_muc_san_pham["English"]["id"] = "";
	$fieldLabelstbl_danh_muc_san_pham["English"]["ten_danh_muc"] = "Ten Danh Muc";
	$fieldToolTipstbl_danh_muc_san_pham["English"]["ten_danh_muc"] = "";
	if (count($fieldToolTipstbl_danh_muc_san_pham["English"])){
		$tdatatbl_danh_muc_san_pham[".isUseToolTips"]=true;
	}
}


	
	$tdatatbl_danh_muc_san_pham[".NCSearch"]=true;

	

$tdatatbl_danh_muc_san_pham[".shortTableName"] = "tbl_danh_muc_san_pham";
$tdatatbl_danh_muc_san_pham[".nSecOptions"] = 0;
$tdatatbl_danh_muc_san_pham[".recsPerRowList"] = 1;	
$tdatatbl_danh_muc_san_pham[".tableGroupBy"] = "0";
$tdatatbl_danh_muc_san_pham[".mainTableOwnerID"] = "";
$tdatatbl_danh_muc_san_pham[".moveNext"] = 1;




$tdatatbl_danh_muc_san_pham[".showAddInPopup"] = false;

$tdatatbl_danh_muc_san_pham[".showEditInPopup"] = false;

$tdatatbl_danh_muc_san_pham[".showViewInPopup"] = false;


$tdatatbl_danh_muc_san_pham[".fieldsForRegister"] = array();
	
$tdatatbl_danh_muc_san_pham[".listAjax"] = false;

	$tdatatbl_danh_muc_san_pham[".audit"] = true;

	$tdatatbl_danh_muc_san_pham[".locking"] = false;
	
$tdatatbl_danh_muc_san_pham[".listIcons"] = true;
$tdatatbl_danh_muc_san_pham[".edit"] = true;
$tdatatbl_danh_muc_san_pham[".inlineEdit"] = true;
$tdatatbl_danh_muc_san_pham[".view"] = true;

$tdatatbl_danh_muc_san_pham[".exportTo"] = true;

$tdatatbl_danh_muc_san_pham[".printFriendly"] = true;

$tdatatbl_danh_muc_san_pham[".delete"] = true;

$tdatatbl_danh_muc_san_pham[".showSimpleSearchOptions"] = false;

$tdatatbl_danh_muc_san_pham[".showSearchPanel"] = true;


$tdatatbl_danh_muc_san_pham[".isUseAjaxSuggest"] = true;

$tdatatbl_danh_muc_san_pham[".rowHighlite"] = true;


// button handlers file names

$tdatatbl_danh_muc_san_pham[".addPageEvents"] = false;

$tdatatbl_danh_muc_san_pham[".arrKeyFields"][] = "id";

// use datepicker for search panel
$tdatatbl_danh_muc_san_pham[".isUseCalendarForSearch"] = false;

// use timepicker for search panel
$tdatatbl_danh_muc_san_pham[".isUseTimeForSearch"] = false;

$tdatatbl_danh_muc_san_pham[".isUseiBox"] = false;


$tdatatbl_danh_muc_san_pham[".useDetailsPreview"] = true;	

$tdatatbl_danh_muc_san_pham[".isUseInlineAdd"] = true;

$tdatatbl_danh_muc_san_pham[".isUseInlineEdit"] = true;
$tdatatbl_danh_muc_san_pham[".isUseInlineJs"] = $tdatatbl_danh_muc_san_pham[".isUseInlineAdd"] || $tdatatbl_danh_muc_san_pham[".isUseInlineEdit"];

$tdatatbl_danh_muc_san_pham[".allSearchFields"] = array();

$tdatatbl_danh_muc_san_pham[".globSearchFields"][] = "id";
// do in this way, because combine functions array_unique and array_merge returns array with keys like 1,2, 4 etc
if (!in_array("id", $tdatatbl_danh_muc_san_pham[".allSearchFields"]))
{
	$tdatatbl_danh_muc_san_pham[".allSearchFields"][] = "id";	
}
$tdatatbl_danh_muc_san_pham[".globSearchFields"][] = "ten_danh_muc";
// do in this way, because combine functions array_unique and array_merge returns array with keys like 1,2, 4 etc
if (!in_array("ten_danh_muc", $tdatatbl_danh_muc_san_pham[".allSearchFields"]))
{
	$tdatatbl_danh_muc_san_pham[".allSearchFields"][] = "ten_danh_muc";	
}


$tdatatbl_danh_muc_san_pham[".googleLikeFields"][] = "id";
$tdatatbl_danh_muc_san_pham[".googleLikeFields"][] = "ten_danh_muc";



$tdatatbl_danh_muc_san_pham[".advSearchFields"][] = "id";
// do in this way, because combine functions array_unique and array_merge returns array with keys like 1,2, 4 etc
if (!in_array("id", $tdatatbl_danh_muc_san_pham[".allSearchFields"])) 
{
	$tdatatbl_danh_muc_san_pham[".allSearchFields"][] = "id";	
}
$tdatatbl_danh_muc_san_pham[".advSearchFields"][] = "ten_danh_muc";
// do in this way, because combine functions array_unique and array_merge returns array with keys like 1,2, 4 etc
if (!in_array("ten_danh_muc", $tdatatbl_danh_muc_san_pham[".allSearchFields"])) 
{
	$tdatatbl_danh_muc_san_pham[".allSearchFields"][] = "ten_danh_muc";	
}

$tdatatbl_danh_muc_san_pham[".isTableType"] = "list";


	

$tdatatbl_danh_muc_san_pham[".isDisplayLoading"] = true;

$tdatatbl_danh_muc_san_pham[".isResizeColumns"] = false;

	$tdatatbl_danh_muc_san_pham[".subQueriesSupAccess"] = true;




$tdatatbl_danh_muc_san_pham[".pageSize"] = 20;

$gstrOrderBy = "";
if(strlen($gstrOrderBy) && strtolower(substr($gstrOrderBy,0,8))!="order by")
	$gstrOrderBy = "order by ".$gstrOrderBy;
$tdatatbl_danh_muc_san_pham[".strOrderBy"] = $gstrOrderBy;
	
$tdatatbl_danh_muc_san_pham[".orderindexes"] = array();

$tdatatbl_danh_muc_san_pham[".sqlHead"] = "SELECT id,  ten_danh_muc";
$tdatatbl_danh_muc_san_pham[".sqlFrom"] = "FROM tbl_danh_muc_san_pham";
$tdatatbl_danh_muc_san_pham[".sqlWhereExpr"] = "";
$tdatatbl_danh_muc_san_pham[".sqlTail"] = "";




//fill array of records per page for list and report without group fields
$arrRPP = array();
$arrRPP[] = 10;
$arrRPP[] = 20;
$arrRPP[] = 30;
$arrRPP[] = 50;
$arrRPP[] = 100;
$arrRPP[] = 500;
$arrRPP[] = -1;
$tdatatbl_danh_muc_san_pham[".arrRecsPerPage"] = $arrRPP;

//fill array of groups per page for report with group fields
$arrGPP = array();
$arrGPP[] = 1;
$arrGPP[] = 3;
$arrGPP[] = 5;
$arrGPP[] = 10;
$arrGPP[] = 50;
$arrGPP[] = 100;
$arrGPP[] = -1;
$tdatatbl_danh_muc_san_pham[".arrGroupsPerPage"] = $arrGPP;

	$tableKeys = array();
	$tableKeys[] = "id";
	$tdatatbl_danh_muc_san_pham[".Keys"] = $tableKeys;

//	id
	$fdata = array();
	$fdata["strName"] = "id";
	$fdata["ownerTable"] = "tbl_danh_muc_san_pham";
		$fdata["Label"]="Id"; 
	
		
		
	$fdata["FieldType"]= 3;
	
		$fdata["AutoInc"]=true;
	
			$fdata["UseiBox"] = false;
	
	$fdata["EditFormat"]= "Text field";
	$fdata["ViewFormat"]= "";
	
		
		
		
		
		$fdata["NeedEncode"]=true;
	
	$fdata["GoodName"]= "id";
	
		$fdata["FullName"]= "id";
	
		$fdata["IsRequired"]=true; 
	
		
		
		
		
				$fdata["Index"]= 1;
				$fdata["EditParams"]="";
			
		$fdata["bListPage"]=true; 
	
		
		
		
		
		$fdata["bViewPage"]=true; 
	
		$fdata["bAdvancedSearch"]=true; 
	
		$fdata["bPrinterPage"]=true; 
	
		$fdata["bExportPage"]=true; 
	
	//Begin validation
	$fdata["validateAs"] = array();
				$fdata["validateAs"]["basicValidate"][] = getJsValidatorName("Number");	
						$fdata["validateAs"]["basicValidate"][] = "IsRequired";
	
				//End validation
	
				$fdata["FieldPermissions"]=true;
	
		
				
		
		
		
			$tdatatbl_danh_muc_san_pham["id"]=$fdata;
//	ten_danh_muc
	$fdata = array();
	$fdata["strName"] = "ten_danh_muc";
	$fdata["ownerTable"] = "tbl_danh_muc_san_pham";
		$fdata["Label"]="Ten Danh Muc"; 
	
		
		
	$fdata["FieldType"]= 200;
	
		
			$fdata["UseiBox"] = false;
	
	$fdata["EditFormat"]= "Text field";
	$fdata["ViewFormat"]= "";
	
		
		
		
		
		$fdata["NeedEncode"]=true;
	
	$fdata["GoodName"]= "ten_danh_muc";
	
		$fdata["FullName"]= "ten_danh_muc";
	
		
		
		
		
		
				$fdata["Index"]= 2;
				$fdata["EditParams"]="";
			$fdata["EditParams"].= " maxlength=200";
			$fdata["EditParams"].= " size=60";
	
		$fdata["bListPage"]=true; 
	
		$fdata["bAddPage"]=true; 
	
		$fdata["bInlineAdd"]=true; 
	
		$fdata["bEditPage"]=true; 
	
		$fdata["bInlineEdit"]=true; 
	
		$fdata["bViewPage"]=true; 
	
		$fdata["bAdvancedSearch"]=true; 
	
		$fdata["bPrinterPage"]=true; 
	
		$fdata["bExportPage"]=true; 
	
	//Begin validation
	$fdata["validateAs"] = array();
		
				//End validation
	
				$fdata["FieldPermissions"]=true;
	
		
				
		
		
		
			$tdatatbl_danh_muc_san_pham["ten_danh_muc"]=$fdata;

	
$tables_data["tbl_danh_muc_san_pham"]=&$tdatatbl_danh_muc_san_pham;
$field_labels["tbl_danh_muc_san_pham"] = &$fieldLabelstbl_danh_muc_san_pham;
$fieldToolTips["tbl_danh_muc_san_pham"] = &$fieldToolTipstbl_danh_muc_san_pham;

// -----------------start  prepare master-details data arrays ------------------------------//
// tables which are detail tables for current table (master)
$detailsTablesData["tbl_danh_muc_san_pham"] = array();
$dIndex = 1-1;
			$strOriginalDetailsTable="tbl_san_pham";
	$detailsTablesData["tbl_danh_muc_san_pham"][$dIndex] = array(
		  "dDataSourceTable"=>"tbl_san_pham"
		, "dOriginalTable"=>$strOriginalDetailsTable
		, "dShortTable"=>"tbl_san_pham"
		, "masterKeys"=>array()
		, "detailKeys"=>array()
		, "dispChildCount"=> "1"
		, "hideChild"=>"0"
		, "sqlHead"=>"SELECT tbl_san_pham.id,  tbl_san_pham.ma_san_pham,  tbl_san_pham.ten_san_pham,  tbl_san_pham.hinh_anh,  tbl_san_pham.mo_ta_san_pham,  tbl_san_pham.mo_ta_ngan_gon,  tbl_san_pham.ham_luong,  tbl_san_pham.cong_dung,  tbl_san_pham.huong_dan_su_dung,  tbl_san_pham.tin_khuyen_mai,  tbl_san_pham.ma_danh_muc,  tbl_danh_muc_san_pham.ten_danh_muc,  tbl_danh_muc_san_pham.id AS danhmucid"	
		, "sqlFrom"=>"FROM tbl_san_pham  INNER JOIN tbl_danh_muc_san_pham ON tbl_san_pham.ma_danh_muc = tbl_danh_muc_san_pham.id"	
		, "sqlWhere"=>""
		, "sqlTail"=>""
		, "groupBy"=>"0"
		, "previewOnList" => 1
		, "previewOnAdd" => 0
		, "previewOnEdit" => 0
		, "previewOnView" => 0
	);	
		$detailsTablesData["tbl_danh_muc_san_pham"][$dIndex]["masterKeys"][]="id";
		$detailsTablesData["tbl_danh_muc_san_pham"][$dIndex]["detailKeys"][]="ma_danh_muc";


	
// tables which are master tables for current table (detail)
$masterTablesData["tbl_danh_muc_san_pham"] = array();

// -----------------end  prepare master-details data arrays ------------------------------//

require_once(getabspath("classes/sql.php"));










$proto62=array();
$proto62["m_strHead"] = "SELECT";
$proto62["m_strFieldList"] = "id,  ten_danh_muc";
$proto62["m_strFrom"] = "FROM tbl_danh_muc_san_pham";
$proto62["m_strWhere"] = "";
$proto62["m_strOrderBy"] = "";
$proto62["m_strTail"] = "";
$proto63=array();
$proto63["m_sql"] = "";
$proto63["m_uniontype"] = "SQLL_UNKNOWN";
	$obj = new SQLNonParsed(array(
	"m_sql" => ""
));

$proto63["m_column"]=$obj;
$proto63["m_contained"] = array();
$proto63["m_strCase"] = "";
$proto63["m_havingmode"] = "0";
$proto63["m_inBrackets"] = "0";
$proto63["m_useAlias"] = "0";
$obj = new SQLLogicalExpr($proto63);

$proto62["m_where"] = $obj;
$proto65=array();
$proto65["m_sql"] = "";
$proto65["m_uniontype"] = "SQLL_UNKNOWN";
	$obj = new SQLNonParsed(array(
	"m_sql" => ""
));

$proto65["m_column"]=$obj;
$proto65["m_contained"] = array();
$proto65["m_strCase"] = "";
$proto65["m_havingmode"] = "0";
$proto65["m_inBrackets"] = "0";
$proto65["m_useAlias"] = "0";
$obj = new SQLLogicalExpr($proto65);

$proto62["m_having"] = $obj;
$proto62["m_fieldlist"] = array();
						$proto67=array();
			$obj = new SQLField(array(
	"m_strName" => "id",
	"m_strTable" => "tbl_danh_muc_san_pham"
));

$proto67["m_expr"]=$obj;
$proto67["m_alias"] = "";
$obj = new SQLFieldListItem($proto67);

$proto62["m_fieldlist"][]=$obj;
						$proto69=array();
			$obj = new SQLField(array(
	"m_strName" => "ten_danh_muc",
	"m_strTable" => "tbl_danh_muc_san_pham"
));

$proto69["m_expr"]=$obj;
$proto69["m_alias"] = "";
$obj = new SQLFieldListItem($proto69);

$proto62["m_fieldlist"][]=$obj;
$proto62["m_fromlist"] = array();
												$proto71=array();
$proto71["m_link"] = "SQLL_MAIN";
			$proto72=array();
$proto72["m_strName"] = "tbl_danh_muc_san_pham";
$proto72["m_columns"] = array();
$proto72["m_columns"][] = "id";
$proto72["m_columns"][] = "ten_danh_muc";
$proto72["m_columns"][] = "hinh_anh";
$obj = new SQLTable($proto72);

$proto71["m_table"] = $obj;
$proto71["m_alias"] = "";
$proto73=array();
$proto73["m_sql"] = "";
$proto73["m_uniontype"] = "SQLL_UNKNOWN";
	$obj = new SQLNonParsed(array(
	"m_sql" => ""
));

$proto73["m_column"]=$obj;
$proto73["m_contained"] = array();
$proto73["m_strCase"] = "";
$proto73["m_havingmode"] = "0";
$proto73["m_inBrackets"] = "0";
$proto73["m_useAlias"] = "0";
$obj = new SQLLogicalExpr($proto73);

$proto71["m_joinon"] = $obj;
$obj = new SQLFromListItem($proto71);

$proto62["m_fromlist"][]=$obj;
$proto62["m_groupby"] = array();
$proto62["m_orderby"] = array();
$obj = new SQLQuery($proto62);

$queryData_tbl_danh_muc_san_pham = $obj;
$tdatatbl_danh_muc_san_pham[".sqlquery"] = $queryData_tbl_danh_muc_san_pham;

$tableEvents["tbl_danh_muc_san_pham"] = new eventsBase;

?>
